/**
 * Created by dale on 2017/10/26.
 */
$(document).ready(function () {


    var form = new xhForm($('#xh_form'));
    form.parse();
    $(".form-date").datetimepicker({format: 'yyyy-mm-dd',language: 'zh-CN',minView: "month", autoclose:true});

    form.fill(contentInfo);
    var iBPCId=addressUri.getParam('iBPCId');
    var iNodeState=addressUri.getParam('iNodeState');
    $('[name=iBPCId]').val(iBPCId);
    $('[name=iNodeState]').val(iNodeState);


    $('#bt_modal_confirm',parent.document).click(function () {
        $.ajax({
            url:modelUrl+'plan/changeNodeState',
            data:$('#xh_form').serialize(),
            type:'POST',
            success:function (data) {
                if(data=='success'){
                    $params=window.top.xhTop.getActiveFrame().getParams(contentInfo['iBPPId']);
                    window.top.xhTop.getActiveFrame().planList.treegrid('load',$params);
                    window.top.xhTop.closeModal();
                }else {
                    window.top.swal('错误',data,'error');
                }
            },
            error:function (data) {
                console.log(data);
            }
        });
    });
    //
    // modalBind.bindClick();



});